package com.sdp.wx.db.wx_wz_input_detail.service.impl;

import com.sdp.core.bizc.db.IViewQuery;
import com.sdp.wx.db.wx_wz_input_detail.entity.WxWzInputDetail;
import com.sdp.wx.db.wx_wz_input_detail.mapper.WxWzInputDetailMapper;
import com.sdp.wx.db.wx_wz_input_detail.service.IWxWzInputDetailService;
import com.sdp.wx.view.WxWzInputView;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

import org.apache.ibatis.session.ResultHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zsp
 * @since 2024-01-26
 */
@Service
public class WxWzInputDetailServiceImpl extends ServiceImpl<WxWzInputDetailMapper, WxWzInputDetail> implements IWxWzInputDetailService,IViewQuery {

	@Autowired
	private WxWzInputDetailMapper wxWzInputDetailMapper;
	
	@Override
	public void queryInputInfo(QueryWrapper<WxWzInputView> queryWrapper, ResultHandler<WxWzInputView> handler) {
		wxWzInputDetailMapper.queryInputInfo(queryWrapper, handler);
		
	}

	@Override
	public <T> List<T> viewList(QueryWrapper<T> queryWrapper) {
		return wxWzInputDetailMapper.viewList(queryWrapper);
	}

	@Override
	public <T> int viewCount(QueryWrapper<T> queryWrapper) {
		return wxWzInputDetailMapper.viewCount(queryWrapper);
	}

	@Override
	public <T> IPage<T> viewPage(IPage<T> page, QueryWrapper<T> queryWrapper) {
		return wxWzInputDetailMapper.viewPage(page, queryWrapper);
	}

	@Override
	public List<WxWzInputDetail> queryWzInputDetailByCode(String inputCode) {
		LambdaUpdateWrapper<WxWzInputDetail> queryWrapper = new LambdaUpdateWrapper<>();
		queryWrapper.in(WxWzInputDetail::getInputCode, inputCode);
		return list(queryWrapper);
	}

	@Override
	public List<WxWzInputDetail> queryWzInputDetailByIds(List<String> ids) {
		LambdaUpdateWrapper<WxWzInputDetail> queryWrapper = new LambdaUpdateWrapper<>();
		queryWrapper.in(WxWzInputDetail::getKeyId, ids);
		return list(queryWrapper);
	}

}
